home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / internet / net commander 1.0 / ISP / SCRPTLST / AINFOMET.CMD < prev    next >
Encoding:
Text File  |  1996-02-15  |  2.0 KB  |  119 lines

  1. # This is the Login script for Trumpet, to be used for AI SLIP connects
  2. # (c) 1995, American InfoMetrics
  3. # Trumpet, (c) 1994, Trumpet Software International
  4. #
  5. #trace on
  6. #
  7. # set up some strings for dialling up
  8. #
  9. if ![load $number]
  10.   if [query $number "Enter your dial up phone number"]
  11.     save $number
  12.   end
  13. end
  14. if ![load $username]
  15.   if [username "Enter your login username"]
  16.     save $username
  17.   end
  18. end
  19. if ![load $password]
  20.   if [password "Enter your login password"]
  21.     save $password
  22.   end
  23. end
  24. $modemsetup = "&c1&d2"
  25. $prompt = "}"
  26. $userprompt = "login:"
  27. $passprompt = "word:"
  28. $slipcmd = "slirp"
  29. $addrtarg = "Your address is"
  30. $pppcmd = "slirp -P"
  31.  
  32. %attempts = 10
  33. #
  34. #
  35. #----------------------------------------------------------
  36. #
  37. # initialize modem
  38. #
  39. output "atz"\13
  40. if ! [input 10 OK\n]
  41.   display "Modem is not responding"\n
  42.   abort
  43. end
  44. #
  45. # setup our modem commands
  46. #
  47. output "at"$modemsetup\13
  48. input 10 OK\n
  49. #
  50. # send phone number
  51. #
  52. %n = 0
  53. repeat
  54.   if %n = %attempts
  55.     display "Too many dial attempts"\n
  56.     abort
  57.   end
  58.   output "atdt"$number\13
  59.   %ok = [input 30 CONNECT]
  60.   %n = %n + 1
  61. until %ok
  62. input 10 \n
  63. #
  64. #  wait till it's safe to send because some modem's hang up
  65. #  if you transmit during the connection phase
  66. #
  67. wait 30 dcd
  68. #
  69. # now prod the terminal server
  70. #
  71. output \13
  72. #
  73. #  wait for the username prompt
  74. #
  75. input 30 $userprompt
  76. output $username\13
  77. #
  78. # and the password
  79. #
  80. input 30 $passprompt
  81. output $password\13
  82. #
  83. # we are now logged in
  84. #
  85. input 30 $prompt
  86. if %ppp
  87.   #
  88.   # jump into ppp mode
  89.   #
  90.   output $pppcmd\13
  91.   #
  92.   input 30 \n
  93.   #
  94.   display "PPP mode selected.  Will try to negotiate IP address."\n
  95.   #
  96. else
  97.   #
  98.   # jump into slip mode
  99.   #
  100.   output $slipcmd\13
  101.   end
  102.   #
  103.   # wait for the address string
  104.   #
  105.   input 30 $addrtarg
  106.   #
  107.   # parse address
  108.   #
  109.   address 30
  110.   input 30 \n
  111.   #
  112.   # we are now connected, logged in and in slip mode.
  113.   #
  114.   display \n
  115.   display Connected.  Your IP address is \i.\n
  116. end
  117. #
  118. # now we are finished.
  119. #